package Chapter10_InnerClass;

/**
 * Date: 2019/2/19
 * Time: 11:10
 * User: Driss.
 */
class Parcel4 {
    private class PContents implements Contents{
        private int i = 11;
        public int value(){return i;}
    }

    protected class PDestination implements Destination{
        private String label;
        private PDestination(String whereTo){
            this.label = whereTo;
        }
        public String readLabel(){return label;}
    }


    public Destination destination(String s){
        return new PDestination(s);
    }

    public Contents contents(){
        return new PContents();
    }

}


public class TestParcel{
    public static void main(String[] args) {
        Parcel4 parcel4 = new Parcel4();
        Contents c = parcel4.contents();
        Destination d = parcel4.destination("Tasmania");
    }
}